package org.springblade.modules.admin.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description 申请状态 （对应blade_estate_application_form表status）
 * @Author ysq
 * @Date 2022/5/27
 **/
@Getter
@AllArgsConstructor
public enum WatermarkTypeEnum {

	OFFLINE_CHECK_SIGN(10, "离线签到"),
	CHECK_RECORD(1, "保养记录"),

	CHECK_SIGN_IN(2, "保养签到"),
	CHECK_SIGN_OUT(3, "保养签退"),
	MAL_RECORD(4, "维修记录"),
	MAL_SIGN_IN(5, "维修签到"),
	MAL_SIGN_OUT(6, "维修签退"),
	PARTS_RECORD(7, "配件记录"),
	PARTS_SIGN_IN(8, "配件签到"),

	PARTS_SIGN_OUT(9, "配件签退");

	final int id;

	final String name;

	/**
	 * 根据status获取枚举name值
	 * @param status 枚举status
	 * @return name值
	 */
	public static String getName(Integer status){
		if (status == null) {
			return null;
		}

		WatermarkTypeEnum[] values = WatermarkTypeEnum.values();
		for(WatermarkTypeEnum statusEnum :values){
			Integer enumStatus = statusEnum.getId();
			if(enumStatus.equals(status)){
				return statusEnum.getName();
			}
		}
		return null;
	}
}
